package sprintServer.start;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import sprintServer.dbconnect.Conn;

public class LoginStateUdpdate {
	StringBuffer sql = new StringBuffer();
	Connection con ;
	PreparedStatement pstmt;
	public String loginStateUpdate(String id){
		String result="";
		String pass;
		sql.append("update member set state=1 ");
		sql.append("where id = ? ");
		try{
			con = Conn.getConnection();
			pstmt = con.prepareStatement(sql.toString());
			pstmt.setString(1, id);
			int a = pstmt.executeUpdate();
					if(a !=0){
						result = "success";
					}else{
						result = "false";
					}
			
		}catch(SQLException se){}
		finally{
			try{if(pstmt != null)pstmt.close();}catch	(SQLException se1){}
			try{if(con != null)con.close();}catch	(SQLException se1){}			
		}
		return result;
	}
}
